<template>
    <div class="form-btn">
        <el-button v-for="item in btns" :key="item.url"
                   :type="item.type"
                   :icon="item.icon"
                   @click="custMethod(item.url)">{{item.name}}
        </el-button>
    </div>
</template>

<script>
    import mixinBtns from '@/assets/minxin/op-bnts'

    export default {
        mixins: [mixinBtns],
        name: "form-btns",
        data() {
            return {
                btns: [
                    {url: 'close', name: '取消', icon: 'fa fa-close', type: 'danger'},
                    {url: 'submit', name: '暂存', icon: 'fa fa-save', type: 'primary'},
                    {url: 'register', name: '立案', icon: 'fa fa-check', type: 'success'}
                ]
            }
        },
        methods: {
            setBtns(btns) {
                this.btns = btns || [];
            }
        }
    }
</script>

<style lang="scss">
    .form-btn {
        float: right;
        min-height: 40px;

        .el-button + .el-button {
            margin: 0;
        }

        .el-button {
            padding: 7px 10px;
            margin: 0 5px !important;

            .fa {
                padding: 0 3px;
            }
        }
    }
</style>
